#if !defined(SwitcherHeader)
#define SwitcherHeader

class Atom;
class Reference;
class Stream;
class Tree;
class Tuple;

// We neither can form switch()es for downcasting (in predicates), nor we can
//  bear too much virtual functions in Node class. Thus we introduce a base
//  class that others can inherit to perform switch.
class Switcher {
public:
  virtual ~Switcher () {
  }

  virtual bool atom (Atom&) { // String included
    return false;
  }

  virtual bool number (Number&) {
    return false;
  }

  virtual bool stream (Stream&) {
    return false;
  }

  virtual bool tree (Tree&) {
    return false;
  }

  virtual bool tuple (Tuple&) {
    return false;
  }

  virtual bool unbinded (Reference&) {
    return false;
  }
};

#endif
